import 'package:stacked/stacked.dart';
import 'package:vista/shared/services/auth_focus.dart';

/// 设置页面视图模型
/// 管理设置页面的数据和状态
class SettingsViewModel extends BaseViewModel {
  final AuthFocus _authFocus;

  SettingsViewModel(this._authFocus);

  /// 退出登录
  Future<void> logout() async {
    setBusy(true);
    try {
      await _authFocus.logout();
    } finally {
      setBusy(false);
    }
  }

  /// 删除账号（实际是退出登录）
  Future<void> deleteAccount() async {
    setBusy(true);
    try {
      // 实际逻辑是退出登录
      await _authFocus.logout();
    } finally {
      setBusy(false);
    }
  }
}
